import api from "@/libs/request";

/**
 * 获取会员列表
 * @param data
 */
export const getMemberList = (data: any) => {
  return api.get(`/account/manager/memberList`, data);
};

/**
 * 获取会员等级
 * @param data
 */
export const getMemberCardRankList = (data: any) => {
  return api.get(`/account/manager/use/memberCardRank`, data);
};

/**
 * 获取会员等级
 * @param data
 */
export const getRankList = (data: any) => {
  return api.get(`/account/manager/getMemberCardRank`, data);
};

/**
 * 获取会员等级
 * @param data
 */
export const getMemberCardRank = (data: any) => {
  return api.get(`/account/manager/use/memberCardRank`, data);
};

/**
 * 设为会员提交
 * @param data
 */
export const setMember = (data: any) => {
  return api.post(`/account/manager/setMember`, data);
};

/**
 * 会员续费
 * @param data
 */
export const expireTime = (data: any) => {
  return api.post(`/account/manager/updateMemberExpireTime`, data);
};

/**
 * 会员升级
 * @param data
 */
export const updateRank = (data: any) => {
  return api.post(`/account/manager/upgradeMemberRank`, data);
};

/**
 * 发送验证码
 * @param data
 */
export const sendCode = (data: any) => {
  return api.get(`/account/manager/sendCode`, data);
};

/**
 * 获取会员卡信息
 * @param data
 */
export const getMemberCard = (data: any) => {
  return api.get(`/account/manager/getMemberCardInfo`, data);
};

/**
 * 会员卡保存
 * @param data
 */
export const saveMemberCard = (data: any) => {
  return api.post(`/account/manager/saveMemberCardInfo`, data, {
    headers: {
      "Content-Type": "application/json",
    },
  });
};

/**
 * 会员卡状态
 * @param data
 */
export const updateMemberCardInfoStatus = (data: any) => {
  return api.post(`/account/manager/updateMemberCardInfoStatus`, data, {
    headers: {
      "Content-Type": "application/json",
    },
  });
};

/**
 * 会员功能开关
 * @param data
 */
export const setMemberCardInfoStatus = (data: any) => {
  return api.post(`/account/manager/setMemberCardInfoStatus`, data);
};

/**
 * 获取会员权益
 * @param data
 */
export const getMemberCardPrivilege = (data: any) => {
  return api.get(`/account/manager/getMemberCardPrivilege`, data);
};

/**
 * 关闭开启会员卡权益
 * @param data
 */
export const updateMemberCardPrivilegeStatus = (data: any) => {
  return api.post(`/account/manager/updateMemberCardPrivilegeStatus`, data);
};

/**
 * 添加自定义权益
 * @param data
 */
export const insertMemberCardPrivilege = (data: any) => {
  return api.post(`/account/manager/insertMemberCardPrivilege`, data);
};

/**
 * 添加自定义权益
 * @param data
 */
export const deleteMemberCardPrivilege = (data: any) => {
  return api.post(`/account/manager/deleteMemberCardPrivilege`, data);
};

/**
 * 更新权益
 * @param data
 */
export const updateMemberCardPrivilege = (data: any) => {
  return api.post(`/account/manager/updateMemberCardPrivilege`, data);
};

/**
 * 储值订单
 * @param data
 */
export const getMemberOrderInfo = (data: any) => {
  return api.get(`/account/manager/getMemberOrderInfo`, data);
};

/**
 * 备注
 */
export const remarks = (data: any) => {
  return api.post(`/account/manager/note`, data);
};

/**
 * 保存储值规则
 * @param data
 */
export const saveMemberPayRule = (data: any) => {
  return api.post(`/account/manager/saveMemberPayRule`, data);
};

/**
 * 获取储值规则
 * @param data
 */
export const getMemberPayRule = (data: any) => {
  return api.get(`/account/manager/getMemberPayRule`, data);
};

/**
 * 获取会员功能状态
 * @param data
 */
export const getMemberCardInfoSwitch = (data: any) => {
  return api.get(`/account/manager/getMemberCardInfoSwitch`, data);
};

/**
 * 获取会员更新
 * @param data
 */
export const getMemberCardUpgrade = (data: any) => {
  return api.get(`/account/manager/getMemberCardUpgrade`, data);
};

/**
 * 获取余额明细
 * @param data
 */
export const getBalanceDetail = (data: any) => {
  return api.get(`/account/api/getMemberBalanceRecord`, data);
};

/**
 * 获取会员卡记录
 * @param data
 */
export const getMemberRecord = (data: any) => {
  return api.get(`/account//manager/getMemberRecord`, data);
};
